package leetcode.code986;

import leetcode.IDebug;
import leetcode.helper.HelpDebug;

public abstract class Solution986 implements IDebug {

	public abstract int[][] intervalIntersection(int[][] firstList, int[][] secondList);

	private void debug(String firstList1, String secondList1, String expect1) {
		int[][] firstList = HelpDebug.str2array1(firstList1);
		int[][] secondList = HelpDebug.str2array1(secondList1);
		int[][] result = this.intervalIntersection(firstList, secondList);
		int[][] expect = HelpDebug.str2array1(expect1);
		HelpDebug.compare(expect, result);
	}

	@Override
	public void debug1() {
		String firstList1 = "[[0,2],[5,10],[13,23],[24,25]]";
		String secondList1 = "[[1,5],[8,12],[15,24],[25,26]]";
		String expect1 = "[[1,2],[5,5],[8,10],[15,23],[24,24],[25,25]]";
		this.debug(firstList1, secondList1, expect1);
	}

	@Override
	public void debug2() {
		String firstList1 = "[[1,3],[5,9]]";
		String secondList1 = "[]";
		String expect1 = "[]";
		this.debug(firstList1, secondList1, expect1);
	}

	@Override
	public void debug3() {
		String firstList1 = "[]";
		String secondList1 = "[[4,8],[10,12]]";
		String expect1 = "[]";
		this.debug(firstList1, secondList1, expect1);
	}

	@Override
	public void debug4() {
		String firstList1 = "[[1,7]]";
		String secondList1 = "[[3,10]]";
		String expect1 = "[[3,7]]";
		this.debug(firstList1, secondList1, expect1);
	}

	public void debug5() {
		String firstList1 = "[[17,20]]";
		String secondList1 = "[[2,3],[6,8],[12,14],[19,20]]";
		String expect1 = "[[19,20]]";
		this.debug(firstList1, secondList1, expect1);
	}

}
